package com.farm.shop.dao;


import com.farm.shop.domain.FarmRoomDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 农家房间表
 *
 * @author chglee
 * @email 1992lcg@163.com
 * @date 2019-09-06 19:44:49
 */
@Mapper
public interface FarmRoomDao {

    FarmRoomDO get(Long id);

    List<FarmRoomDO> list(Map<String, Object> map);

    int count(Map<String, Object> map);

    int save(FarmRoomDO farmRoom);

    int update(FarmRoomDO farmRoom);

    int remove(Long id);

    int batchRemove(Long[] ids);

    /**
     * search
     *
     * @param keyword 关键字
     * @return List<FarmRoomDO>
     */
    @Select(value = "SELECT * FROM farm_room WHERE room_name LIKE '%${keyword}%' or room_describe LIKE '%${keyword}%'")
    List<FarmRoomDO> search(@Param("keyword") String keyword);

    List<FarmRoomDO> searchName(Map<String, Object> map);

    int searchNameCount(Map<String, Object> map);
}
